﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace Model.Core {
    /// <summary>
    /// 基础操作类，所有数据操作继承此类
    /// </summary>
    internal abstract class BaseOperator<TEntity> : IOperator<TEntity> where TEntity : class {
        public abstract void Create(TEntity modelEntity);
        public abstract TEntity Retrieve(Guid id);
        public abstract void Modify(TEntity modelEntity);
        public abstract void Destroy(TEntity modelEntity);
        public abstract IQueryable<TEntity> CreateQuery();
        public abstract void BatchDelete(Expression<Func<TEntity, bool>> predicate);
        public abstract void BatchUpdate(Expression<Func<TEntity, bool>> wherePredicate, Expression<Func<TEntity, TEntity>> predicate);

        public virtual void Dispose() {
            ((IDisposable)this).Dispose();
        }


    }
}
